import request from '@/utils/request'

// 获取房间列表
export const getRoomList = () => {
  return request({
    url: '/room',
    method: 'get'
  })
}

// 删除房间
export const deleteRoom = (id) => {
  return request({
    url: `/room/${id}`,
    method: 'delete'
  })
}

// 添加房间
export const addRoom = (data) => {
  return request({
    url: '/room',
    method: 'post',
    data
  })
}

// 根据family_id查询房间
export const getRoomByFamilyId = (familyId) => {
  return request({
    url: `/room/family/${familyId}`,
    method: 'get'
  })
}

// 修改房间
export const updateRoom = (data) => {
  return request({
    url: '/room',
    method: 'put',
    data
  })
} 